package com.beidu.lottery.call.entity.dto;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;
import javax.validation.groups.Default;
import java.time.LocalDateTime;

/**
 * 订单基础信息DTO
 *
 * @author 北渡
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class OrderBaseDTO {

    @NotNull(message = "订单ID不能为空", groups = UpdateExpressNo.class)
    private Integer id;

    @NotNull(message = "订单编号不能为空", groups = UpdateReceiveInfo.class)
    private String orderNo;

    @NotEmpty(message = "领奖人昵称不能为空", groups = UpdateReceiveInfo.class)
    private String consigneeNickname;

    @NotEmpty(message = "领奖人手机号不能为空", groups = UpdateReceiveInfo.class)
    private String consigneePhone;

    @NotEmpty(message = "领奖地址不能为空", groups = UpdateReceiveInfo.class)
    private String consigneeAddress;

    @ApiModelProperty(value = "快递单号")
    @NotEmpty(message = "快递单号不能为空", groups = UpdateExpressNo.class)
    private String expressNo;

    @ApiModelProperty(value = "订单状态(0:未发放, 1:待发放, 2:已发放, 3:已失效)")
    private Integer orderStatus;

    @ApiModelProperty(value = "更新人id")
    private String updatedBy;

    @ApiModelProperty(value = "更新时间")
    private LocalDateTime updatedDate;

    /**
     * 更新收货信息(提交领奖信息)和缺省验证组
     */
    public interface UpdateReceiveInfo extends Default {
    }

    /**
     * 更新快递单号和缺省验证组
     */
    public interface UpdateExpressNo extends Default {
    }

}
